package com.haha.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.haha.demo.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface UserDao extends BaseMapper<User> {
    @Update("update user set uname=#{uname},upwd=#{upwd},utype=#{utype},umemo=#{umemo} where ucode=#{ucode}")
    int update(@Param("uname") String uname,@Param("upwd") String upwd,@Param("utype") int utype,@Param("umemo") String umemo,@Param("ucode") int ucode);
    @Delete("delete from user where ucode=#{id}")
    int delete(int id);
    @Insert("insert into user(uname,upwd,utype,umemo) values (#{uname},#{upwd},#{utype},#{umemo})")
    int insert(User user);
}
